<template>
	<view>
		<view class="head_box">
			<view class="search-BIG-box">
				<image class="searchIcon" :src="$IMG_URL+'/static/images/BIG-icon/search.png'" mode=""></image>
				<input type="text" v-model="keyWord" placeholder="请输入···"
					placeholder-style="color: #666666;font-size: 13px;">
				<!-- <image class="yuyinIcon" style="width: 13px;height: 17px;" :src="$IMG_URL+'/static/images/index_top/yuyin.png'"
					mode=""></image> -->
			</view>
			<view class="search-BIG-btn" @click="keyWordFun">
				搜索
			</view>
		</view>
		<view class="content_box">
			<view class="cell_content_box" v-for="(item,index) in list" :key="index" @click="toDetail(item.id)">
				<view class="box_img_cell">
					<image :src="item.cover_image" mode="widthFix"></image>
				</view>
				<view class="cell_content_box_right">
					<text class="cell_title">{{item.title}}</text>
					<text class="cell_time">{{item.createtime}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import http from '@/shopro/request/index'
	import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
	export default {
		data() {
			return {
				keyWord:'',
				list:[]
			};
		},
		methods:{
			keyWordFun(){
				http('common.manual',{word:this.keyWord}).then(res=>{
					console.log(res);
					this.list = res.data
				})
				
				// console.log('sousuo');
			},
			toDetail(tent){
				uni.navigateTo({
					url:'./saveDetail?id='+tent
				})
			}
		},
		onLoad() {
			http('common.manual').then(res=>{
				console.log(res);
				this.list = res.data
			})
			// this.list = this.$store.state.shopro.manual
			// console.log('急救手册打印数据',this.list);
		}
	}
</script>

<style lang="scss">
	page {
		font-family: MicrosoftYaHei;
		background-color: rgb(242, 242, 242);
	}
	.head_box {
		display: flex;
		padding: 16px 10px 15px;
		background-color: #fff;
		border-top: 1px solid #e5e5e5;

		.search-BIG-box {
			display: flex;
			flex: 1;
			height: 34px;
			background-color: #ffffff;
			border-radius: 17px;
			border: solid 2px #e5e5e5;
			align-items: center;
			padding: 0 15px;
			box-sizing: border-box;

			input {
				flex: 1;
			}

			.searchIcon {
				width: 16px;
				height: 16px;
				margin-right: 9px;
			}
		}

		.search-BIG-btn {
			height: 34px;
			background-image: linear-gradient(90deg,
					#ff8300 0%,
					#ff3d00 100%),
				linear-gradient(#ff4000,
					#ff4000);
			background-blend-mode: normal,
				normal;
			border-radius: 17px;
			padding: 11px 21px;
			box-sizing: border-box;
			display: flex;
			align-items: center;
			color: #fff;
			margin-left: 5px;
		}
	}
	.content_box {
		.cell_content_box {
			display: flex;
			background-color: #fff;
			width: 94%;
			margin: 0 auto;
			padding: 8px 9px;
			box-sizing: border-box;
			margin-top: 12px;
			border-radius: 5px;
			.box_img_cell {
				width: 75px;
				height: 75px;
				// background-color: #bababa;
				border-radius: 3px;
				overflow: hidden;
				display: flex;
				align-items: center;
			}
			.cell_content_box_right {
				flex: 1;
				margin-left: 12px;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				.cell_title {
					font-size: 20px;
						font-weight: bold;
					display: block;
				}
				.cell_time {
					font-size: 13px;
					color: #999;
				}
			}
		}
	}
</style>